import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class word01_ {
    public static void main(String[] args) throws IOException {
        String dpath="d:\\dome";
        File file=new File(dpath);
        if (!file.exists()){
            if (file.mkdirs()){
                System.out.println("创建成功！");
            }else {
                System.out.println("创建失败！");
            }
        }
        String pathname=dpath+"\\hello.txt";
        file=new File(pathname);
        if (!file.exists()) {
            if (file.createNewFile()) {
                System.out.println("创建成功！");
                BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file));
                bufferedWriter.write("hello,world~");
                bufferedWriter.close();
            } else {
                System.out.println("创建失败！");
            }
        }
    }
}
